<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8">
    
    <title>numpy.polynomial.legendre.legval &mdash; NumPy v1.18 Manual</title>
    
    <link rel="stylesheet" type="text/css" href="../../_static/css/spc-bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../../_static/css/spc-extend.css">
    <link rel="stylesheet" href="../../_static/scipy.css" type="text/css" >
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" >
    <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" >
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '1.18.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../_static/language_data.js"></script>
    <script type="text/javascript" src="../../_static/js/copybutton.js"></script>
    <link rel="author" title="About these documents" href="../../about.html" >
    <link rel="index" title="Index" href="../../genindex.html" >
    <link rel="search" title="Search" href="../../search.html" >
    <link rel="top" title="NumPy v1.18 Manual" href="../../index.html" >
    <link rel="up" title="Legendre Module (numpy.polynomial.legendre)" href="../routines.polynomials.legendre.html" >
    <link rel="next" title="numpy.polynomial.legendre.legval2d" href="numpy.polynomial.legendre.legval2d.html" >
    <link rel="prev" title="numpy.polynomial.legendre.Legendre.truncate" href="numpy.polynomial.legendre.Legendre.truncate.html" > 
  </head>
  <body>
<div class="container">
  <div class="top-scipy-org-logo-header" style="background-color: #a2bae8;">
    <a href="../../index.html">
      <img border=0 alt="NumPy" src="../../_static/numpy_logo.png"></a>
    </div>
  </div>
</div>


    <div class="container">
      <div class="main">
        
	<div class="row-fluid">
	  <div class="span12">
	    <div class="spc-navbar">
              
    <ul class="nav nav-pills pull-left">
        <li class="active"><a href="https://numpy.org/">NumPy.org</a></li>
        <li class="active"><a href="https://numpy.org/doc">Docs</a></li>
        
        <li class="active"><a href="../../index.html">NumPy v1.18 Manual</a></li>
        

          <li class="active"><a href="../index.html" >NumPy Reference</a></li>
          <li class="active"><a href="../routines.html" >Routines</a></li>
          <li class="active"><a href="../routines.polynomials.html" >Polynomials</a></li>
          <li class="active"><a href="../routines.polynomials.package.html" >Polynomial Package</a></li>
          <li class="active"><a href="../routines.polynomials.legendre.html" accesskey="U">Legendre Module (<code class="xref py py-mod docutils literal notranslate"><span class="pre">numpy.polynomial.legendre</span></code>)</a></li> 
    </ul>
              
              
    <ul class="nav nav-pills pull-right">
      <li class="active">
        <a href="../../genindex.html" title="General Index"
           accesskey="I">index</a>
      </li>
      <li class="active">
        <a href="numpy.polynomial.legendre.legval2d.html" title="numpy.polynomial.legendre.legval2d"
           accesskey="N">next</a>
      </li>
      <li class="active">
        <a href="numpy.polynomial.legendre.Legendre.truncate.html" title="numpy.polynomial.legendre.Legendre.truncate"
           accesskey="P">previous</a>
      </li>
    </ul>
              
	    </div>
	  </div>
	</div>
        

	<div class="row-fluid">
      <div class="spc-rightsidebar span3">
        <div class="sphinxsidebarwrapper">
  <h4>Previous topic</h4>
  <p class="topless"><a href="numpy.polynomial.legendre.Legendre.truncate.html"
                        title="previous chapter">numpy.polynomial.legendre.Legendre.truncate</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="numpy.polynomial.legendre.legval2d.html"
                        title="next chapter">numpy.polynomial.legendre.legval2d</a></p>
<div id="searchbox" style="display: none" role="search">
  <h4>Quick search</h4>
    <div>
    <form class="search" action="../../search.html" method="get">
      <input type="text" style="width: inherit;" name="q" />
      <input type="submit" value="search" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
          <div class="span9">
            
        <div class="bodywrapper">
          <div class="body" id="spc-section-body">
            
  <div class="section" id="numpy-polynomial-legendre-legval">
<h1>numpy.polynomial.legendre.legval<a class="headerlink" href="#numpy-polynomial-legendre-legval" title="Permalink to this headline">¶</a></h1>
<dl class="function">
<dt id="numpy.polynomial.legendre.legval">
<code class="sig-prename descclassname">numpy.polynomial.legendre.</code><code class="sig-name descname">legval</code><span class="sig-paren">(</span><em class="sig-param">x</em>, <em class="sig-param">c</em>, <em class="sig-param">tensor=True</em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/numpy/numpy/blob/v1.18.1/numpy/polynomial/legendre.py#L832-L917"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#numpy.polynomial.legendre.legval" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluate a Legendre series at points x.</p>
<p>If <em class="xref py py-obj">c</em> is of length <em class="xref py py-obj">n + 1</em>, this function returns the value:</p>
<div class="math">
<p><img src="../../_images/math/907e2fc6b3540764fc1d2449b1161d9aae7e15da.svg" alt="p(x) = c_0 * L_0(x) + c_1 * L_1(x) + ... + c_n * L_n(x)"/></p>
</div><p>The parameter <em class="xref py py-obj">x</em> is converted to an array only if it is a tuple or a
list, otherwise it is treated as a scalar. In either case, either <em class="xref py py-obj">x</em>
or its elements must support multiplication and addition both with
themselves and with the elements of <em class="xref py py-obj">c</em>.</p>
<p>If <em class="xref py py-obj">c</em> is a 1-D array, then <em class="xref py py-obj">p(x)</em> will have the same shape as <em class="xref py py-obj">x</em>.  If
<em class="xref py py-obj">c</em> is multidimensional, then the shape of the result depends on the
value of <em class="xref py py-obj">tensor</em>. If <em class="xref py py-obj">tensor</em> is true the shape will be c.shape[1:] +
x.shape. If <em class="xref py py-obj">tensor</em> is false the shape will be c.shape[1:]. Note that
scalars have shape (,).</p>
<p>Trailing zeros in the coefficients will be used in the evaluation, so
they should be avoided if efficiency is a concern.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>x</strong><span class="classifier">array_like, compatible object</span></dt><dd><p>If <em class="xref py py-obj">x</em> is a list or tuple, it is converted to an ndarray, otherwise
it is left unchanged and treated as a scalar. In either case, <em class="xref py py-obj">x</em>
or its elements must support addition and multiplication with
with themselves and with the elements of <em class="xref py py-obj">c</em>.</p>
</dd>
<dt><strong>c</strong><span class="classifier">array_like</span></dt><dd><p>Array of coefficients ordered so that the coefficients for terms of
degree n are contained in c[n]. If <em class="xref py py-obj">c</em> is multidimensional the
remaining indices enumerate multiple polynomials. In the two
dimensional case the coefficients may be thought of as stored in
the columns of <em class="xref py py-obj">c</em>.</p>
</dd>
<dt><strong>tensor</strong><span class="classifier">boolean, optional</span></dt><dd><p>If True, the shape of the coefficient array is extended with ones
on the right, one for each dimension of <em class="xref py py-obj">x</em>. Scalars have dimension 0
for this action. The result is that every column of coefficients in
<em class="xref py py-obj">c</em> is evaluated for every element of <em class="xref py py-obj">x</em>. If False, <em class="xref py py-obj">x</em> is broadcast
over the columns of <em class="xref py py-obj">c</em> for the evaluation.  This keyword is useful
when <em class="xref py py-obj">c</em> is multidimensional. The default value is True.</p>
<div class="versionadded">
<p><span class="versionmodified added">New in version 1.7.0.</span></p>
</div>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><strong>values</strong><span class="classifier">ndarray, algebra_like</span></dt><dd><p>The shape of the return value is described above.</p>
</dd>
</dl>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="numpy.polynomial.legendre.legval2d.html#numpy.polynomial.legendre.legval2d" title="numpy.polynomial.legendre.legval2d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legval2d</span></code></a>, <a class="reference internal" href="numpy.polynomial.legendre.leggrid2d.html#numpy.polynomial.legendre.leggrid2d" title="numpy.polynomial.legendre.leggrid2d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">leggrid2d</span></code></a>, <a class="reference internal" href="numpy.polynomial.legendre.legval3d.html#numpy.polynomial.legendre.legval3d" title="numpy.polynomial.legendre.legval3d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legval3d</span></code></a>, <a class="reference internal" href="numpy.polynomial.legendre.leggrid3d.html#numpy.polynomial.legendre.leggrid3d" title="numpy.polynomial.legendre.leggrid3d"><code class="xref py py-obj docutils literal notranslate"><span class="pre">leggrid3d</span></code></a></p>
</div>
<p class="rubric">Notes</p>
<p>The evaluation uses Clenshaw recursion, aka synthetic division.</p>
</dd></dl>

</div>


          </div>
        </div>
          </div>
        </div>
      </div>
    </div>

    <div class="container container-navbar-bottom">
      <div class="spc-navbar">
        
      </div>
    </div>
    <div class="container">
    <div class="footer">
    <div class="row-fluid">
    <ul class="inline pull-left">
      <li>
        &copy; Copyright 2008-2019, The SciPy community.
      </li>
      <li>
      Last updated on Feb 20, 2020.
      </li>
      <li>
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 2.4.2.
      </li>
    </ul>
    </div>
    </div>
    </div>
  </body>
</html>